<!doctype html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script src="spellcheck_test.js"></script>
<script>
const line = 'zz zz zz zz zz zz zz zz.';
const checkedLine = '#zz# #zz# #zz# #zz# #zz# #zz# #zz# #zz#.';

function repeatLine(line, linebreak) {
  return (line + linebreak).repeat(9) + line;
}

spellcheck_test(
    `<div contenteditable>${repeatLine(line, '<br>')}</div>`,
    document => document.querySelector('div').focus(),
    `<div contenteditable>${repeatLine(checkedLine, '<br>')}</div>`,
    {
      title: 'Cold mode checks full contenteditable',
      needsFullCheck: true
    }
);

spellcheck_test(
    `<textarea>${repeatLine(line, '\n')}</textarea>`,
    document => document.querySelector('textarea').focus(),
    `<textarea>${repeatLine(checkedLine, '\n')}</textarea>`,
    {
      title: 'Cold mode checks full textarea',
      needsFullCheck: true
    }
);
</script>
